package com.atguigu.service.impl;

import com.atguigu.mapper.UserMapper;
import com.atguigu.pojo.Emp;
import com.atguigu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: liuaojun
 * @CreateTime: 2025-02-05
 * @Description:
 * @Version: 1.0
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public void insertUser(Emp emp) {
        userMapper.insertUser(emp);
    }

    @Override
    public void updateUser(Emp emp) {
        userMapper.updateUser(emp);
    }

    @Override
    public void deleteUser(Integer id) {
        userMapper.deleteUser(id);
    }

    @Override
    public Emp getEmpById(Integer id) {
        Emp emp = userMapper.selectUser(id);
        return emp;
    }

    @Override
    public List<Emp> getAllEmp() {
        List<Emp> empList = userMapper.selectAllUser();
        return empList;
    }
}
